package org.etnaframework.module.localcache;

/**
 * Type1类型的缓存（定时全量重新加载，没有其他更新机制）
 *
 * @author jasyaf
 * @since 2023-11-01
 */
public class LocalCacheType1<T> implements ILocalCache<T> {

    private final LocalCacheCore<T> localCacheCore;

    @Override
    public T get() {
        return localCacheCore.get();
    }

    LocalCacheType1(String name, String scheduledFullUpdateCron, long timeoutSec, ILocalCacheCustomizer<T> customizer) {
        localCacheCore = new LocalCacheCore<>(name, scheduledFullUpdateCron, timeoutSec, customizer, null);
        localCacheCore.start();
    }
}
